package com.csproj.dispatch.service.dto;


import com.csproj.dispatch.util.DateJsonDeserializer;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;

import java.io.Serializable;
import java.time.ZonedDateTime;
import java.util.Objects;

/**
 * A DTO for the ProductDetailInfo entity.
 */
@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
public class ProductDetailInfoDTO implements Serializable {

    private String id;

    private String infoId;

    private String hsCode;

    private String productName;

    private String spc;

    private Double quantity;

    private String unidade;

    private String origin;

    private String destination;

    private Double price;

    private Double total;

    private String moeda;

    private Boolean deletedFlag;

    private String deleterUserId;
    @JsonDeserialize(using = DateJsonDeserializer.class)
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8", locale = "zh")
    private ZonedDateTime deletionTime;
    @JsonDeserialize(using = DateJsonDeserializer.class)
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8", locale = "zh")
    private ZonedDateTime lastModificationTime;

    private String lastModifierUserId;
    @JsonDeserialize(using = DateJsonDeserializer.class)
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8", locale = "zh")
    private ZonedDateTime creationTime;

    private String creatorUserId;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getInfoId() {
        return infoId;
    }

    public void setInfoId(String infoId) {
        this.infoId = infoId;
    }

    public String getHsCode() {
        return hsCode;
    }

    public void setHsCode(String hsCode) {
        this.hsCode = hsCode;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public String getSpc() {
        return spc;
    }

    public void setSpc(String spc) {
        this.spc = spc;
    }

    public Double getQuantity() {
        return quantity;
    }

    public void setQuantity(Double quantity) {
        this.quantity = quantity;
    }

    public String getUnidade() {
        return unidade;
    }

    public void setUnidade(String unidade) {
        this.unidade = unidade;
    }

    public String getOrigin() {
        return origin;
    }

    public void setOrigin(String origin) {
        this.origin = origin;
    }

    public String getDestination() {
        return destination;
    }

    public void setDestination(String destination) {
        this.destination = destination;
    }

    public Double getPrice() {
        return price;
    }

    public void setPrice(Double price) {
        this.price = price;
    }

    public Double getTotal() {
        return total;
    }

    public void setTotal(Double total) {
        this.total = total;
    }

    public String getMoeda() {
        return moeda;
    }

    public void setMoeda(String moeda) {
        this.moeda = moeda;
    }

    public Boolean isDeletedFlag() {
        return deletedFlag;
    }

    public void setDeletedFlag(Boolean deletedFlag) {
        this.deletedFlag = deletedFlag;
    }

    public String getDeleterUserId() {
        return deleterUserId;
    }

    public void setDeleterUserId(String deleterUserId) {
        this.deleterUserId = deleterUserId;
    }

    public ZonedDateTime getDeletionTime() {
        return deletionTime;
    }

    public void setDeletionTime(ZonedDateTime deletionTime) {
        this.deletionTime = deletionTime;
    }

    public ZonedDateTime getLastModificationTime() {
        return lastModificationTime;
    }

    public void setLastModificationTime(ZonedDateTime lastModificationTime) {
        this.lastModificationTime = lastModificationTime;
    }

    public String getLastModifierUserId() {
        return lastModifierUserId;
    }

    public void setLastModifierUserId(String lastModifierUserId) {
        this.lastModifierUserId = lastModifierUserId;
    }

    public ZonedDateTime getCreationTime() {
        return creationTime;
    }

    public void setCreationTime(ZonedDateTime creationTime) {
        this.creationTime = creationTime;
    }

    public String getCreatorUserId() {
        return creatorUserId;
    }

    public void setCreatorUserId(String creatorUserId) {
        this.creatorUserId = creatorUserId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        ProductDetailInfoDTO productDetailInfoDTO = (ProductDetailInfoDTO) o;
        if(productDetailInfoDTO.getId() == null || getId() == null) {
            return false;
        }
        return Objects.equals(getId(), productDetailInfoDTO.getId());
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(getId());
    }

    @Override
    public String toString() {
        return "ProductDetailInfoDTO{" +
            "id=" + getId() +
            ", infoId='" + getInfoId() + "'" +
            ", hsCode='" + getHsCode() + "'" +
            ", productName='" + getProductName() + "'" +
            ", spc='" + getSpc() + "'" +
            ", quantity=" + getQuantity() +
            ", origin='" + getOrigin() + "'" +
            ", destination='" + getDestination() + "'" +
            ", price=" + getPrice() +
            ", total=" + getTotal() +
            ", moeda='" + getMoeda() + "'" +
            ", deletedFlag='" + isDeletedFlag() + "'" +
            ", deleterUserId='" + getDeleterUserId() + "'" +
            ", deletionTime='" + getDeletionTime() + "'" +
            ", lastModificationTime='" + getLastModificationTime() + "'" +
            ", lastModifierUserId='" + getLastModifierUserId() + "'" +
            ", creationTime='" + getCreationTime() + "'" +
            ", creatorUserId='" + getCreatorUserId() + "'" +
            "}";
    }
}
